package lxh.grails.basic;

import groovy.sql.Sql;

def gsql = Sql.newInstance("jdbc:mysql://127.0.0.1/gappdb", "root", "111111", "com.mysql.jdbc.Driver")
gsql.eachRow("select * from AUTHOR where name='Mike'") { println it.id+":"+it.name }
gsql.eachRow("select count(*) from AUTHOR"){println it[0]}
def author = gsql.dataSet("AUTHOR");

author.each
{
	println "${it.name}";
}


